/**
* 团队管理
*/
import React, { Component } from 'react';
import { View, StyleSheet, Text, Image, TouchableOpacity, Linking } from "react-native";
import { connect } from 'react-redux';
import { create_service } from '../../redux/index.js';
import { Contract } from '../../service/index.js';
import { Colors, Dimens, ImageRes } from '../../utils/Assets';
import { ProgressView } from '../custom/index'
import { Actions } from 'react-native-router-flux';
class TeamRateView extends Component {

    constructor(props) {
        super(props);
        this.state = {
            loading: false
        }
    }

    componentDidMount() {

    }
    componentWillUnmount() {
    }
    render() {
        return (
            <View style={styles.container}>
                <View style={{ backgroundColor: "#ffffff", paddingVertical: 20, flexDirection: 'row', justifyContent: "space-between", paddingHorizontal: 15, marginTop: 10 }}>
                    <View style={{ flexDirection: 'row' }}>
                        <Image style={{ width: 20, height: 20, alignSelf: 'center' }} source={ImageRes.team_user} resizeMode={'contain'}></Image>
                        <Text style={{ fontSize: 15, color: "#333333", alignSelf: 'center', marginLeft: 15 }}>用户</Text>
                    </View>
                    <Text style={{ fontSize: 15, color: "#999999", alignSelf: 'center', marginRight: 15, fontWeight: 'bold' }}>
                        {this.props.real_name}
                    </Text>
                </View>
                <View style={{ backgroundColor: "#ffffff", paddingVertical: 20, flexDirection: 'row', justifyContent: "space-between", paddingHorizontal: 15, marginTop: 1 }}>
                    <View style={{ flexDirection: 'row' }}>
                        <Image style={{ width: 20, height: 20, alignSelf: 'center' }} source={ImageRes.team_phone} resizeMode={'contain'}></Image>
                        <Text style={{ fontSize: 15, color: "#333333", alignSelf: 'center', marginLeft: 15 }}>电话</Text>
                    </View>
                    <Text style={{ fontSize: 15, color: "#378EFB", alignSelf: 'center', marginRight: 15, fontWeight: 'bold' }} onPress={() => {
                        Linking.openURL(`tel:${this.props.mobile}`)
                    }}>
                        {this.props.mobile}
                    </Text>
                </View>
                <TouchableOpacity style={{ backgroundColor: "#ffffff", paddingVertical: 20, flexDirection: 'row', justifyContent: "space-between", paddingHorizontal: 15, marginTop: 1 }} activeOpacity={0.8} onPress={() => {
                    Actions.teamChangeRateView({ users_id: this.props.users_id, editable: true, title: '费率更改' })
                }}>
                    <View style={{ flexDirection: 'row' }}>
                        <Image style={{ width: 20, height: 20, alignSelf: 'center' }} source={ImageRes.team_rate} resizeMode={'contain'}></Image>
                        <Text style={{ fontSize: 15, color: "#333333", alignSelf: 'center', marginLeft: 15 }}>费率</Text>
                    </View>
                    <View style={{ flexDirection: 'row' }}>
                        {/* <Text style={{ fontSize: 15, color: "#FC2222", alignSelf: 'center', marginRight: 15, fontWeight: 'bold' }}>万 50</Text> */}
                        <Image source={ImageRes.team_right_arrow} style={{ width: 10, height: 16, alignSelf: 'center' }}></Image>
                    </View>
                </TouchableOpacity>
                <ProgressView show={this.state.loading} />
            </View>
        )
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: Colors.bg_color,
    }
});
const ExportView = connect()(TeamRateView);
module.exports.TeamRateView = ExportView
